package practice;

/**
 * Created with IntelliJ IDEA.
 * Description:两数之和
 * User: YJ
 * Date: 2023-9-21
 * Time: 19:44
 */
public class Solution1 {
    public int[] twoSum(int[] nums, int target) {
        int n = nums.length;
        for (int i = 0;i < n;i++) {
            for(int j = i + 1;j < n;j++) {
                if(nums[i] + nums[j] == target) {
                    return new int[]{i,j};
                }
            }
        }
        return new int[]{0};
    }
}
